#include "Album.h"
#include "DurationCounter.h"

void Album::Add (MusicMedia * mm) {
	if ( mm == 0 ) throw std::exception("null pointer in Album::Add");
	if (mm->getKind() != eSong) {
		throw std::exception("error: you tried to add a musicmedia which is no song to an album...");
	}

	mMedia.push_back(mm);
}

void Album::Accept(IVisitor * visitor) {
	if ( visitor == 0 ) throw std::exception("null pointer in Album::Accept");
	visitor->Visit(this);
	for (TMediaConstIterator it = mMedia.begin(); it != mMedia.end(); ++it) {
		(*it)->Accept(visitor);
	}
}

std::string const * Album::getInterpret() const {
	return &mInterpret;
}